#include "debug.h"


Debug m_Debug= Debug();

Debug::Debug()
{
    DEBUG_FOR_ANSER = 0;
    DEBUG_FOR_REAL = 0;
    DEBUG_FOR_FUNCTION = 0;
}

void Debug::DEBUG(unsigned char str[], int nlen, int var)
{
    switch(var)
    {
        //打印问答模式的数据帧
    case 1:
        if(DEBUG_FOR_ANSER)
        {
            for(int i = 0 ; i < nlen ; i++)
            {
                printf("%02x ",str[i]);
            }
            printf("\n");
        }
    break;
        //打印实时数据
    case 2:
        if(DEBUG_FOR_REAL)
        {
            for(int i = 0 ; i < nlen ; i++)
            {
                printf("%02x ",str[i]);
            }
            printf("\n");
        }
    break;
    }

}

void Debug::FuncPrint(char str[])
{
   if(DEBUG_FOR_FUNCTION)
   {
       printf("%s\n",str);
   }
}
